import request from '@/utils/request';
import { handleReturnMD5 } from '@/utils/utils';

export async function query() {
  return request('/api/users');
}
export async function queryMenu() {
  return request('/admin/sys/menu/system', { params: { sysMenu: 0 } });
}

export async function queryCurrent() {
  return request('/api/currentUser');
}
export async function queryNotices() {
  return request('/api/notices');
}
export async function editFirstPwd(payload) {
  payload.confirmPassword = handleReturnMD5(payload.confirmPassword);
  payload.oldPassword = handleReturnMD5(payload.oldPassword);
  payload.password = handleReturnMD5(payload.password);
  return request('employee/password', {
    method: 'PUT',
    data: payload,
  });
}
export async function editPwd(payload) {
  payload.confirmPassword = handleReturnMD5(payload.confirmPassword);
  payload.oldPassword = handleReturnMD5(payload.oldPassword);
  payload.password = handleReturnMD5(payload.password);
  return request('employee/password', {
    method: 'PUT',
    data: payload,
  });
}
